﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace ParserGenerator.ParserConstruction
{
    [Serializable]
    public sealed class ParserAutomatonInadequacyNodes : ReadOnlyCollection<ParserAutomatonInadequacyNode>
    {
        internal ParserAutomatonInadequacyNodes()
            : base(new List<ParserAutomatonInadequacyNode>())
        {
        }

        internal void Add(ParserAutomatonInadequacyNode node)
        {
            if (node == null)
                throw new ArgumentNullException(nameof(node));
            Items.Add(node);
        }
    }
}
